<template>
  <div class="text-right com-page-box">
    <el-pagination 
      @size-change="handleSizeChange" 
      @current-change="handleCurrentChange" 
      :page-sizes="[10, 20, 50, 100]" 
      :page-size="page.pageSize" 
      :current-page.sync="page.pageNo"
      layout="total, sizes, prev, pager, next, jumper" 
      :total="page.total">
    </el-pagination>
  </div>
</template>
<script>
export default {
  name: 'com-page',
  props:{
    page:{
      type:Object,
      default: () => ({})
    },
  },
  methods: {
    //每页条数改变
    handleSizeChange(val) {
      this.$emit('change',val,true);
    },
    //页码改变
    handleCurrentChange(val) {
      this.$emit('change',val,false);
    },
  }
}
</script>

<style lang="scss" scoped>
.com-page-box {
  padding-top: 15px;
}
</style>